pub fn odd_fibnacci_sum(threshold: u32) -> u32 {
    let mut prev = 0;
    let mut curr = 1;
    let mut count = 1;
    return std::iter::from_fn(move || {
        if count == 1 {
            count += 1;
            return Some(prev);
        } else if count == 2 {
            count += 1;
            return Some(curr);
        } else if curr < threshold {
            let next = prev + curr;
            prev = curr;
            curr = next;
            count += 1;
            return Some(curr);
        } else {
            return None;
        }
    })
    .filter(|it| *it % 2 == 1 && *it < threshold)
    .sum();
}
